<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>API-流程DEMO</title>
<script type="text/javascript" src="/gobal/js/jquery/jquery-2.0.3.min.js"></script>
<body>
<table border="1" width="100%">
    <tr>
        <td style="width: 5%;">#</td>
        <td style="width: 10%;">接口名称</td>
        <td style="width: 15%;">接口地址</td>
        <td style="width: 15%;">接口说明</td>
        <td style="width: 5%;">请求方式</td>
        <td style="width: 45%;">参数</td>
        <td style="width: 5%;">操作</td>
    </tr>
    <tr>
        <td>1</td>
        <td>创建流程</td>
        <td>http://ip:port/</td>
        <td>第三方系统创建流程</td>
        <td>
            超链接
        </td>
        <td>
            accountId=admin&returnUrl=http://192.168.3.7:91/app/core/apibpmstart?flowId=
        </td>
        <td><a href="http://192.168.3.7:91/account/pcImSso?accountId=admin&returnUrl=http://192.168.3.7:91/app/core/apibpmstart?flowId=05A6E7F6-BF36-4453-BF7B-D5C89F3A2142">发起流程</a></td>
    </tr>
    <tr>
        <td>2</td>
        <td>获取流程待办表列</td>
        <td>http://ip:port/ret/bpmget/getGoProcessList</td>
        <td>指定流程的指定步骤转交</td>
        <td>
            post
        </td>
        <td>
            {<br>
            accountId:"admin"//有身份证不需要<br>
            }
        </td>
        <td>
            <button onclick="getMyWorkList()">待办列表</button>
        </td>
    </tr>

    <tr>
        <td>3</td>
        <td>流程转交下一步</td>
        <td>http://ip:port/set/bpmset/goNextProcess</td>
        <td>指定流程的指定步骤转交</td>
        <td>
            post
        </td>
        <td>
            {<br>
            accountId:"admin",//有身份证不需要<br>
            autoSendUser: "",<br>
            msgContent: "",<br>
            nextPrcsInfo: "[{\"processId\":\"1FF3676A-7942-4761-98E3-EFF88266AFD4\",\"prcsType\":\"3\",\"opUser\":\"admin\",\"otherOpUser\":\"\"}]",<br>
            remindCreateUser: "",<br>
            remindNextUser: "",<br>
            remindParticipant: "",<br>
            runId: "54C8F3A3-49E7-430F-A1B5-9DA99D5861F0",<br>
            runProcessId: "34BF1926-1374-4BF0-9E8C-D4DDE6928495"<br>
            }
        </td>
        <td>
            <button onclick="workflowNext()">提交</button>
        </td>
    </tr>
    <tr>
        <td>4</td>
        <td>获取表单数据</td>
        <td>http://ip:port/ret/bpmget/getBpmFormRecordByBpmList</td>
        <td>指定流程的指定步骤转交</td>
        <td>
            post
        </td>
        <td>
            {<br>
            accountId:"admin",//有身份证不需要<br>
            runId: "54C8F3A3-49E7-430F-A1B5-9DA99D5861F0"<br>
            }
        </td>
        <td>
            <button onclick="getBpmFormRecordByBpmList()">获取表单数据</button>
        </td>
    </tr>

    <tr>
        <td>5</td>
        <td>工作流保存数据</td>
        <td>http://ip:port/set/bpmset/saveFormData</td>
        <td>保存指定流程的表单数据</td>
        <td>
            post
        </td>
        <td>
            {
            accountId:"admin",//有身份证不需要<br>
            runId: "54C8F3A3-49E7-430F-A1B5-9DA99D5861F0",<br>
            runProcessId: "34BF1926-1374-4BF0-9E8C-D4DDE6928495",<br>
            urgency: "",<br>
            attach: "",//流程附件<br>
            passStatus: "",//审批客观意见<br>
            runAttach: "",审批附件ID<br>
            ideaText: "",//审批意见<br>
            formData: "{"dataNum1":"1111","dataNum2":"{\"vkey\":null,\"value\":\"\"}","dataNum3":"
            <测试
            <测式3
            ","dataNum4":"","dataNum5":"","dataNum6":"","dataNum7":"2022-04-14","dataNum8":"","dataNum9":"2022-04-14","dataNum10":"2022-04-14","dataNum11":"OA管理员","dataNum12":"2022年04月14日","dataNum13":"","dataNum14":"","dataNum15":"","dataNum16":"","dataNum17":"","dataNum18":"","dataNum19":"[{\"run_id\":\"54C8F3A3-49E7-430F-A1B5-9DA99D5861F0\",\"unique_id\":\"5100C481-E5CF-4F63-886C-D0D41A7EA858\",\"quantity\":\"333\",\"xiaoji\":\"\",\"remark\":\"\",\"other_t\":\"\",\"other_o\":\"\",\"tiaokuan\":\"\",\"price\":\"\",\"org_id\":\"8EADB678-A646-1E51-3E87-75A547B8AF19\",\"name\":\"\",\"id\":4,\"xt\":\"\"}]","dataNum20":"","dataNum32":"<200","dataNum31":"20178A9F-023C-4E8A-8110-FB1E60C95CB4,4A60A9B5-5D61-40CB-962B-A975C059FD82,CD993AC1-A9BA-47E1-936C-C7FEE25DFC28"}"//表单数据<br>
            }
        </td>
        <td>
            <button onclick="saveFromData()">保存</button>
        </td>
    </tr>
</table>

</body>
<script>
    function getMyWorkList() {
        $.ajax({
            url: "http://192.168.3.7:91/ret/bpmget/getGoProcessList",
            type: "post",
            dataType: "json",
            data: {
                accountId: "admin",
                pageSize: 10,
                pageNumber: 1,
                sort: "id",
            },
            success: function (data) {
                console.log(data);
            }
        });
    }

    function workflowNext() {
        let checkedPrcsNextInfo = [];
        let json = {};
        json.processId = '1FF3676A-7942-4761-98E3-EFF88266AFD4';
        json.prcsType = '3';
        json.opUser = 'admin';
        json.otherOpUser = '';
        checkedPrcsNextInfo.push(json);
        $.ajax({
            url: "http://192.168.3.7:91/set/bpmset/goNextProcess",
            type: "post",
            dataType: "json",
            data: {
                runId: "B040947B-DF3E-4174-8CC1-259825BA135C",
                runProcessId: "E378F970-C377-4A7A-ACFC-F8987B001D23",
                remindNextUser: "",
                remindCreateUser: "",
                remindParticipant: "",
                msgContent: "",
                autoSendUser: "",
                nextPrcsInfo: JSON.stringify(checkedPrcsNextInfo)
            },
            success: function (data) {
                console.log(data);
            }
        });
    }


    function getBpmFormRecordByBpmList() {
        $.ajax({
            url: "http://192.168.3.7:91/ret/bpmget/getBpmFormRecordByBpmList",
            type: "post",
            dataType: "json",
            data: {
                accountId: "admin",
                runId: "B040947B-DF3E-4174-8CC1-259825BA135C"
            },
            success: function (data) {
                console.log(data);
            }
        });
    }

</script>
</html>
